<?php
/**
 * Created by PhpStorm.
 * User: W
 * Date: 2019/1/4
 * Time: 16:30
 */

namespace app\sports_admin\service;
use think\Request;
use app\sports_admin\model\ChildrenHeight;
use app\sports_admin\model\ChildrenWeight;

class Children
{
    //添加身高
    public static function heightAdd()
    {
        $data = Request::instance()->only('height');
        $height = $data['height'];
        //判断是否存在重复值
        $this_height = ChildrenHeight::thisHeight($height);
        if( !$this_height){
            return ChildrenHeight::heightAdd($height);
        }else{
            return false;
        }
    }
    //添加体重
    public static function weightAdd()
    {
        $data = Request::instance()->only('weight');
        $weight = $data['weight'];
        //判断是否存在重复值
        $this_weight = ChildrenWeight::thisWeight($weight);
        if( !$this_weight){
            return ChildrenWeight::weightAdd($weight);
        }else{
            return false;
        }
    }

}